
//
//  UIBarButtonItem+CTItem.m
//  百思不得姐
//
//  Created by leo on 2017/5/19.
//  Copyright © 2017年 mine.com. All rights reserved.
//

#import "UIBarButtonItem+CTItem.h"

@implementation UIBarButtonItem (CTItem)
+(instancetype)itemWithNormalImage:(UIImage *)normalImage highLightImage:(UIImage *)highLightimage target:(id)target action:(SEL)action {
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setImage:normalImage forState:UIControlStateNormal];
    [btn setImage:highLightimage forState:UIControlStateHighlighted];
    [btn sizeToFit];
    [btn addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    UIView *containView = [[UIView alloc] initWithFrame:btn.bounds];
    [containView addSubview:btn];
    return [[UIBarButtonItem alloc] initWithCustomView:containView];
    
}
@end
